package src.数据结构.链表.双向链表;

public class TowNodeTestDemo {
    public static void main(String[] args) {
        TowWayLinkList<String> linkList = new TowWayLinkList();
        for (int i = 0; i < 10; i++) {
            linkList.add("元素:"+i);
        }

        linkList.show();
        linkList.size();

        System.out.println("----------------------------------");

        linkList.insert(1,"新元素:25");
        linkList.show();
        linkList.size();

        System.out.println("----------------------------------");

        System.out.println("弹出的元素:"+linkList.pop());
        linkList.show();
        linkList.size();

        System.out.println("----------------------------------");

        System.out.println(linkList.getEnd());
        System.out.println(linkList.getLast());

        System.out.println("----------------------------------");

        System.out.println(linkList.pop(1));
        linkList.show();
        linkList.size();
        linkList.getMid();

        System.out.println("----------------------------------");

        System.out.println("链表是否有环："+linkList.isRing());
        linkList.ring();
        System.out.println("链表是否有环："+linkList.isRing());
    }
}
